<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Structs</title>
  <link rel="stylesheet" type="text/css" href="../../../../styles.css">
</head>
<body>
<h1>Structs</h1>
  <img alt="Struct Palette" src="../../../images/datalib_struct_palette.png" align="right">

  <p>Structs with attribute isDcpsDataType set to true are
  candidate types to use for Topic types. An example Struct is
  shown below.</p><img alt="Example Struct" src=
  "../../../images/datalib_struct_example.png">

  <p>A Struct is created by selecting a Struct from the palette and
  adding to the diagram.</p>

  <p>After giving your Struct a name you will then want to add
  Fields to it as discussed in <a href="types_with_fields.html">Types with Fields</a>.</p>

  <p>After you define the Fields for the Struct you may want to
  re-order them. You can do so by dragging a field and dropping it
  into the new position.</p>

  <h2>Keys</h2>
  <p>As described in the OpenDDS Developer's Guide available at the <a href=
  "http://download.ociweb.com/OpenDDS/">OpenDDS download
  page</a>, keys are fields used to identify different instances within a
  topic. These key fields are identified by elements in the Struct's Keys
  compartment whose names are that of the fields that act as keys.</p>
  
  <p>Keys for the Struct are created similar to how Fields are
  created. Select the Key tool from the palette and add it to the
  Struct. Then in the Struct figure type the name of the Field that
  should be used for the Key. Similar to how Fields can be
  re-ordered, Keys can be re-ordered by dragging and dropping.</p>

</body>
</html>